﻿@model Romantics.Domain.Objects.Report
@using Romantics
@{
    ViewBag.Title = Model.Name;

    var Action = ((string)ViewContext.RouteData.Values["Action"]);
    var Controller = ((string)ViewContext.RouteData.Values["Controller"]);
}
@section RenderMeta{
    <meta name="description" content="@Model.Options.MetaDescription"/>
    <meta name="author" content="@Model.Options.Author"/>
    <meta name="keywords" content="@Model.Meta ?? @Model.Options.MetaKeywords" />
}
<div id="content">
    <div class="post">
        <div class="post-meta">
            <div class="row">
                <div class="post-title">
                    <h1>@Html.ReportLink(Model)</h1>
                </div>
                <!-- AddThis -->
                <div class="share-links">
                    @Html.Partial("_AddThis")
                </div>
            </div>
            <div class="row">
                <div class="post-category">
                    <span>Катогория:&nbsp;</span>@Html.CategoryLink(Model.Hike.Category, Controller)
                </div>
                <div class="post-category">
                    <span>Регион:&nbsp;</span>@Html.RegionLink(Model.Hike.Region, Controller)
                </div>
            </div>
            <div class="row">
                <span>Маршрут:&nbsp;</span>@Html.Raw(Model.Hike.Route)
            </div>
            <div class="row">
                <div class="post-category">
                    <span>Поход:&nbsp;</span>@Html.HikeLink(Model.Hike)
                </div>
            </div>
            <div class="posted-date">
                @{
                    if (Model.Hike.Duration > 1)
                    {
                    <span>С&nbsp;</span>@Model.Hike.StartDate.ToString("d")<span>&nbsp;по&nbsp;</span>@Model.Hike.EndDate.ToString("d")
                    }
                    else
                    {
                    @Model.Hike.StartDate.ToString("d")
                    }
                }
            </div>
        </div>
        <div class="post-body">
            @Html.Raw(Model.Body)
        </div>
        @{if (Model.Hike.Reports.Where(r => r.Published && r.ID != Model.ID).ToList().Count > 0)
          {
            <div class="row">
                <span>В этом же походе:</span>
                <ul>
                @{foreach (var report in Model.Hike.Reports.Where(r => r.Published && r.ID != Model.ID).ToList())
                  {
                        <li>@Html.ReportLink(report)</li>
                  }
                }
                </ul>
            </div>
          }
        }
        @{if (Model.Hike.PhotoAlbums.Where(a => a.Published).ToList().Count > 0)
            {
            <div class="row">
                <span>Фотоальбомы:</span><br>
                @{foreach (var album in Model.Hike.PhotoAlbums.Where(a => a.Published))
                    {
                        <div class="post-album active">
                            <div class="row">
                                @Html.PhotoAlbumLink(album)
                            </div>
                            @{ var href = album.Href(Url); }
                            <div class="row">
                                <a href="@href">
                                    <img src="@album.Items.First().Small" border="0" />
                                </a>
                            </div>
                        </div>
                    }
                }
            </div>
            }
        }
        @Html.Partial("_DisqusComment")
    </div>
</div>

